<template>
    <div class="login_container">
        <div class="half_left">

        </div>
        <div class="half_right">
            <div class="login-title">
                <Logo :size="120"/> <span class="logon-title-font">{{ config.systemName }}</span>
            </div>
            <div class="login">
                <el-form :model="form"  label-position="top" label-width="120px">
                <el-form-item label="登录名">
                    <el-input v-model="form.username" :placeholder="config.page.usernameInput.placeholder" />
                </el-form-item>
                <el-form-item label="密码">
                    <el-input v-model="form.pwd" type="password" :placeholder="config.page.pwdInput.placeholder" />
                </el-form-item>
            </el-form>
            </div>
            <div class="login-foot">
                <el-checkbox  label="记住我" size="large" />
                <span>忘记密码？</span>
            </div>
            <div class="login-submit"><el-button @click="loginHandler" type="primary" style="width: 100%;" size="large">登录</el-button></div>
            
        </div>
    </div>
</template>
<script setup lang="ts">
import { reactive } from 'vue'
import Logo from '../../components/logo.vue'
import config from './config.json'
import {useRouter} from "vue-router"
let router = useRouter()
const form = reactive<{username:string,pwd:string}>({
    username:"",
    pwd:""
})
const loginHandler = ()=>{
    router.push('/home')
}
</script>
<style lang="less" scoped>
.login_container {
    display: flex;
    width: 100%;
    height: 100%;
    
    .half_left {
        width: 60%;
        // background-color: aqua;
        background-image: url('../../assets/login/bj.jpg');
    }

    .half_right {
        flex: 1;
        // background-color: red;
        display: flex;
        justify-content: center;
        align-items: center;
        flex-direction: column;
        .login{
            width: 70%;
            max-width: 400px;
        }
        .login-title{
            width: 70%;
            max-width: 400px;
            display: flex;
            justify-content: center;
            // margin-bottom: 5%;
            align-items: center;
            .logon-title-font{
                margin-left: 10px;
            }
        }
        .login-submit{
            width: 70%;
            max-width: 400px;
            margin-top: 5%;
        }
        .login-foot{
            display: flex;
            justify-content:space-between;
            align-items: center;
            width: 70%;
            max-width: 400px;
            font-size: 12px;
        }
    }
}
</style>